﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ControlDangKyTuVanVien.ascx.cs" Inherits="WebUserControl_ControlDangKyTuVanVien" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register src="uscTitleForm.ascx" tagname="uscTitleForm" tagprefix="uc1" %>

<%@ Register src="uscMsgBox.ascx" tagname="uscMsgBox" tagprefix="uc2" %>

<link rel="stylesheet" href='<%=ResolveUrl("~/LayoutCss/datePicker.css")%>' type="text/css" />
<script type="text/javascript"  src='<%=ResolveUrl("~/JScript/jquery.alphanumeric.js")%>'></script>

<script type="text/javascript">
     function pageLoad() {
     $("#<%= txtDtCoDinh.ClientID %>").numeric();
     $("#<%= txtDTDiDong.ClientID %>").numeric();
     
      $(function()
     {
	    $("#<%= txtNgayCap.ClientID %>").datePicker(
		{
			clickInput:true,
			startDate: '01/01/1970'
		}
	);
});

 $(function()
     {
	    $("#<%= txtNgaySinh.ClientID %>").datePicker(
		{
			clickInput:true,
			startDate: '01/01/1970'
		}
	);
});

$(function()
     {
	    $("#<%= txtNgayDangKy.ClientID %>").datePicker(
		{
			clickInput:true,
			startDate: '01/01/1970'
		}
	);
});

       $("#<%= ImgSave.ClientID %>").click(function() { 
        if ($("#<%= txtTenTuVanVien.ClientID %>").val().length>0)
        {
        $.blockUI({
             message: '<h1>Xin vui lòng chờ xử lý</h1>', 
            css: { 
            border: 'none', 
            padding: '15px', 
            backgroundColor: '#f00', 
            opacity: .5, 
            color: '#fff' 
        } }); 
        }
        }); 
           $("#<%= ImgNew.ClientID %>").click(function() { 
        $.blockUI({
             message: '<h1>Xin vui lòng chờ xử lý</h1>', 
            css: { 
            border: 'none', 
            padding: '15px', 
            backgroundColor: '#f00', 
            opacity: .5, 
            color: '#fff' 
        } }); 
        }); 
        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
                function EndRequestHandler(sender, args) {
                        $.unblockUI();
                }
        }  
   
</script> 
<style type="text/css">
        .AutoExtender
        {
            font-family: Verdana, Helvetica, sans-serif;
            font-size: .8em;
            font-weight: normal;
            border: solid 1px #006699;
            line-height: 20px;
            padding: 10px;
            background-color: White;
            margin-left:10px;
        }
        .AutoExtenderList
        {
            border-bottom: dotted 1px #006699;
            cursor: pointer;
            color: Maroon;
        }
        .AutoExtenderHighlight
        {
            color: White;
            background-color: #006699;
            cursor: pointer;
        }
        #divwidth
        {
          width: auto !important;    
        }
        #divwidth div
       {
        width: auto !important;   
       }
 </style>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
     <uc1:uscTitleForm ID="uscTitleForm1" runat="server" 
            Messeage="Đăng ký tư vấn viên" />
            <asp:Panel ID="Panel1" runat="server" BackColor="#EBEBEB" 
                        BorderStyle="None" Height="33px" Width="100%">
                        <asp:ImageButton ID="ImgNew" runat="server" CausesValidation="False" 
                            Height="25px" ImageUrl="~/image/New File.png" OnClick="ImgNew_Click" 
                            ToolTip="Tạo mới" Width="25px" />
                        &nbsp;<asp:ImageButton ID="ImgSave" runat="server" Height="25px" 
                            ImageUrl="~/image/floppy disk.png" OnClick="ImgSave_Click" 
                             ToolTip="Cập nhật" Width="25px" />
                        &nbsp;<asp:ImageButton ID="ImgInsert" runat="server" Height="25px" 
                            ImageUrl="~/image/Find.png" CausesValidation="false" OnClick="ImgInsert_Click" ToolTip="Tìm kiếm" 
                            Width="25px" />
                    </asp:Panel>
       
        
        <cc1:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0" 
            BackColor="#CCFFFF" Font-Names="Arial" ForeColor="#3366FF" Height="344px" 
            Width="1004px">
            <cc1:TabPanel ID="TabPanel1" runat="server" HeaderText="Nhập thông tin" TabIndex="0">
                <ContentTemplate>
                   
                    <br />
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:Label ID="Label3" runat="server" Font-Italic="True" Visible="False"></asp:Label>
                    <br />
                    <table style="width:94%;height: 241px;" align="center">
                        <tr>
                            <td>
                                <asp:Label ID="lblTitleMaTvv" runat="server" Text="Mã tư vấn viên" 
                                    Visible="False"></asp:Label>
                            </td>
                            <td class="style1">
                                <asp:TextBox ID="txtMa" runat="server"  MaxLength="15" 
                                    Visible="False"></asp:TextBox>
                            </td>
                            <td>
                                Số CMND</td>
                            <td colspan="5">
                                <asp:TextBox ID="txtSoCMND" runat="server"  Width="226px" 
                                    TabIndex="6"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Tên tư vấn viên</td>
                            <td class="style1">
                                <asp:TextBox ID="txtTenTuVanVien" runat="server" Width="220px"  
                                    MaxLength="30" TabIndex="1">
                                    </asp:TextBox>
                                <asp:RequiredFieldValidator ControlToValidate="txtTenTuVanVien" Display="None"  ID="RequiredFieldValidator1" runat="server" ErrorMessage="Phải nhập tên tư vấn viên">
                                </asp:RequiredFieldValidator>
                                <cc1:ValidatorCalloutExtender TargetControlID="RequiredFieldValidator1" ID="ValidatorCalloutExtender1" runat="server">
                                </cc1:ValidatorCalloutExtender>
                            </td>
                            <td>
                                Ngày cấp</td>
                            <td>
                                <asp:TextBox ID="txtNgayCap" runat="server"  MaxLength="10" TabIndex="7" 
                                    Width="120px"></asp:TextBox>
                               
                            </td>
                            <td colspan="3">
                                Nơi cấp</td>
                            <td>
                                <asp:DropDownList ID="DropNoiCap" runat="server" TabIndex="11">
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Mã người giới thiệu</td>
                            <td class="style1">
                                <asp:TextBox ID="txtMaNguoiGioiThieu" runat="server" AutoPostBack="True"  
                                    Width="64px" MaxLength="15" TabIndex="2" 
                                    ontextchanged="txtMaNguoiGioiThieu_TextChanged"></asp:TextBox>
                                      <div id="divwidth" style="overflow:scroll; height:150px;display:none"></div>
            <cc1:AutoCompleteExtender CompletionSetCount="12"
            CompletionInterval="10" 
            MinimumPrefixLength="1" 
            ServiceMethod="GetTuVanVienInfo"
            TargetControlID="txtMaNguoiGioiThieu"
            ServicePath="~/Services/WebServiceNhapHoaDonBanHang.asmx"
            ID="AutoCompleteExtender1" 
            runat="server" CompletionListItemCssClass="AutoExtenderList"
             DelimiterCharacters="" Enabled="True" 
             CompletionListHighlightedItemCssClass="AutoExtenderHighlight"
             CompletionListElementID="divwidth" 
            CompletionListCssClass="AutoExtender">
            </cc1:AutoCompleteExtender>
                              
                            </td>
                            <td>
                                Ngày sinh</td>
                            <td colspan="3">
                                <asp:TextBox ID="txtNgaySinh" runat="server"  
                                    Width="120px" MaxLength="10" 
                                    TabIndex="12"></asp:TextBox>
                               
                            </td>
                            <td colspan="2">
                                <asp:CheckBox ID="CheckGioiTinh" runat="server" Text="Nam" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Tên người giới thiệu</td>
                            <td class="style1">
                                <asp:TextBox ID="txtTenNguoiGioiThieu" runat="server"  
                                     Width="220px"></asp:TextBox>
                            </td>
                            <td>
                                Nghề nghiệp</td>
                            <td colspan="5">
                                <asp:TextBox ID="txtNgheNghiep" runat="server" 
                                     TabIndex="21" Width="258px" AutoPostBack="False"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Ngày đăng ký</td>
                            <td class="style1">
                                <asp:TextBox ID="txtNgayDangKy" runat="server" 
                                     MaxLength="10" TabIndex="3" Width="120px"></asp:TextBox>
                               
                            </td>
                            <td>
                                Số nhà</td>
                            <td colspan="5">
                                <asp:TextBox ID="txtSoNha" runat="server" AutoPostBack="False" 
                                    TabIndex="13" Width="250px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <asp:CheckBox Visible="false" ID="CheckDaNopTien" runat="server" Text="Đã nộp tiền" 
                                    TabIndex="4" />
                            </td>
                            <td>
                                Đường</td>
                            <td colspan="5">
                                <asp:TextBox ID="txtTenDuong" runat="server"  
                                    TabIndex="14" Width="250px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <asp:CheckBox ID="CheckDoTuVanVien" runat="server" Text="Đỗ tư vấn viên" 
                                    TabIndex="5" />
                            </td>
                            <td>
                                Tỉnh/Thành&nbsp;&nbsp;&nbsp;
                            </td>
                            <td colspan="3">
                                <asp:DropDownList ID="DropTinh" runat="server"  Width="131px" 
                                    TabIndex="15" AutoPostBack="True" 
                                    onselectedindexchanged="DropTinh_SelectedIndexChanged1">
                                </asp:DropDownList>
                            </td>
                            <td>
                                Quận/Huyện</td>
                            <td>
                                <asp:DropDownList ID="DropQuanHuyen" runat="server"  TabIndex="16" 
                                     Width="131px">
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                &nbsp;</td>
                            <td colspan="3">
                                Điện thoại cố định&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
                            <td colspan="3">
                                &nbsp;<asp:TextBox ID="txtDtCoDinh" runat="server"  
                                    TabIndex="17" Width="200px"></asp:TextBox>
                               
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                &nbsp;</td>
                            <td colspan="4">
                                Điện thoại di dộng</td>
                            <td colspan="2">
                                <asp:TextBox ID="txtDTDiDong" runat="server"  
                                     Width="200px" style="margin-left: 0px" 
                                    TabIndex="18"></asp:TextBox>
                                
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                &nbsp;</td>
                            <td>
                                Trình độ</td>
                            <td colspan="3">
                                <asp:DropDownList ID="DropTrinhDo" runat="server" TabIndex="19" 
                                    Width="129px">
                                </asp:DropDownList>
                            </td>
                            <td>
                                Email</td>
                            <td>
                                <asp:TextBox ID="txtEmail" runat="server" AutoPostBack="True"  
                                     Width="150px" TabIndex="20"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                &nbsp;</td>
                            <td>
                                &nbsp;</td>
                            <td colspan="5">
                                &nbsp;</td>
                        </tr>
                    </table>
                </ContentTemplate>
            </cc1:TabPanel>
            <cc1:TabPanel ID="TabPanel2" runat="server" HeaderText="Tìm kiếm" TabIndex="1">
                <ContentTemplate>
                    <br />
                    <table align="center" style="width:37%;">
                    <tr>
                    <td align="center">
                        Nhập thông tin cần tìm&nbsp;
                    </td>
                    </tr>
                        <tr>
                            <td align="center">
                                &nbsp;<asp:TextBox ID="txtSearch" runat="server" ontextchanged="TextBox5_TextChanged" 
                                    Width="168px" AutoPostBack="True"></asp:TextBox>
                                &nbsp;&nbsp;<asp:ImageButton ID="ImageButton1" runat="server" CausesValidation="False" 
                                    ImageUrl="~/image/Search.png" onclick="ImageButton1_Click" 
                                    style="width: 16px" />
                                &nbsp;&nbsp;&nbsp;&nbsp;</td>
                        </tr>
                        <tr>
                            <td>
                                <asp:GridView ID="GridView2" runat="server" AllowPaging="True" 
                                    AutoGenerateColumns="False" BackColor="#DEBA84" BorderColor="#DEBA84" 
                                    BorderStyle="None" BorderWidth="1px" CellPadding="3" CellSpacing="2" 
                                    DataKeyNames="salesp_key" onpageindexchanging="GridView2_PageIndexChanging" 
                                    onrowcommand="GridView2_RowCommand" PageSize="5" Width="306px">
                                    <Columns>
                                        <asp:BoundField DataField="salesp_key" HeaderText="Mã" />
                                        <asp:BoundField DataField="salesp_name" HeaderText="Họ tên" />
                                        <asp:TemplateField>
                                            <ItemTemplate>
                                                <asp:Button ID="Button2" runat="server" CausesValidation="false" 
                                                    CommandName="chon" Text="Chọn" />
                                            </ItemTemplate>
                                            <FooterStyle BackColor="White" BorderColor="White" />
                                            <HeaderStyle BackColor="White" BorderColor="White" />
                                            <ItemStyle BackColor="White" BorderColor="White" />
                                        </asp:TemplateField>
                                    </Columns>
                                    <FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
                                    <HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
                                    <PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
                                    <RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
                                    <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
                                </asp:GridView>
                                <br />
                                <br />
                            </td>
                        </tr>
                    </table>
                </ContentTemplate>
            </cc1:TabPanel>
        </cc1:TabContainer>
        <br />
        <br />
        <br />
        <br />
         <uc2:uscMsgBox ID="uscMsgBox1" runat="server" />
        </ContentTemplate>
     </asp:UpdatePanel> 

 

 